#-*- coding: utf-8 -*-
# Autor : Pedro Lopes
# Data: 7 - 10 - 2013

def fatorial(n):
    if n<=0:
        return 1
    else:
        return n*fatorial(n-1)

print fatorial(10)

def fatorial_cauda(n):
    def fact(i=n,acc=1):
        if i  == 0:
            return acc
        else:
            return fact(i-1,(acc*i))
        return fact()

print fatorial_cauda(10) 


           
